/*
 *  WaveFunctionLogXSineX.h
 *  SoundController0002
 *
 *  Created by jiro on 10/11/20.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#include "Constants.h"
#include "WaveFunction.h"
#include <cmath>
#include <iostream>

namespace sc {

	class WaveFunctionFactory;
	
	/*
		y = - constant * log( ( a * x + b ) ^ powerOfXOfLog ) * sin( 2 * pi * freq * ( a * x + b ) )
		x in [ 0, 1 )
	*/
	class WaveFunctionLogXSinX : public WaveFunction {
	
		friend class WaveFunctionFactory;
		
	private:
	
		double powerOfXOfLog;

	public:

		double operator() ( double time ) const;

		bool operator == ( const WaveFunction& rhs ) const;
		
		bool operator != ( const WaveFunction& rhs ) const;
		
		bool operator < ( const WaveFunction& rhs ) const;
		
		double GetPowerOfXOfLog() const;

	private:
	
		WaveFunctionLogXSinX( double powerOfXOfLog, double cycle, bool isReverse = false, bool isNormalize = true );

	};

}